using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Ras2ClassLib;

public partial class DisplayAllaFlytjanda : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!this.IsPostBack)
		{
			FillList("");
		}
	}
	protected void OnGridViewPageIndexChanging(object sender, GridViewPageEventArgs e)
	{
		m_GridViewFlytjanda.PageIndex = e.NewPageIndex;
		FillList(Convert.ToString(this.ViewState["SortColumn"]));
	}
	protected void OnGridViewSorting(object sender, GridViewSortEventArgs e)
	{
		FillList(e.SortExpression);
	}

	protected void FillList( String strOrderBy )
	{
		FlytjandiDoc doc = new FlytjandiDoc();
		FlytjandiCollection flytjandi = doc.GetAllFlytjandi();
		if (flytjandi != null)
		{
			if ( !String.IsNullOrEmpty(strOrderBy) )
			{
				flytjandi.Sort(strOrderBy);
				this.ViewState[ "SortColumn" ] = strOrderBy;
			}

			m_GridViewFlytjanda.DataSource = flytjandi;
			m_GridViewFlytjanda.DataBind();
		}
	}
}

